// main.js
// import preReClick from './directives/preReClick.js';
// app.use(preReClick)

// 使用   <button @click="confirm" v-preReClick>点我点我</button>
export default (app) => {
    app.directive('preReClick', {
      mounted(el, binding) {
        el.addEventListener('click', () => {
          if (!el.disabled) {
            el.disabled = true;
            setTimeout(() => {
              el.disabled = false;
            }, binding.value || 2000)
          }
        })
      }
    })
}
